package spring.j2024_11_19_2.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import spring.j2024_11_19_2.model.MyList;
import spring.j2024_11_19_2.model.Student;

import java.util.List;

@RestController
@RequestMapping("/yml")
public class YmlController {

//    @Value("${test1.t1}")
//    private String t1 ;
//    @Value("${test1.t2}")
//    private String t2 ;
//    @Value("${test1.t3}")
//    private String t3 ;
//
//    @RequestMapping("/t")
//    public void test(){
////        System.out.println("t1:"+t1);
////        System.out.println("t2:"+t2);
////        System.out.println("t3:"+t3);
//    }
//
//    @Autowired    // 将对象注入进来
//    private Student student ;
//    @RequestMapping("/set")
//    public String set(){
//        return student.toString();
//    }
    @Autowired   // 将对象注入进来
    private MyList myList ;

    @RequestMapping("/l1")
    public String l1(){

        return  myList.toString() + "l1的长度:"+myList.getL1().size();

    }

}
